<?php
namespace app\index\controller;
use think\Controller;

class Index extends Base
{
    
   
   
   
    public function index()
    {
		//获取首页大图广告位
		$mainads = model("Featured")->getAdsByType(0);
		if(empty($mainads)){
			$mainads = 0;
			}
		//获取右侧广告位
		$rightads = model("Featured")->getAdsByType(1);
		if(empty($rightads)){
			$rightads = 0;
			}
		
		//dump($mainads);halt($rightads);
		//商品分类数据——美食
		$datas = model('Deal')->getNormalDealByCategoryCityId(1, $this->city->id);
		//获取四个子分类
		$meishicats = model('Category')->getNormalRecommendCategoryByParentId(1,4);
		
		
		
		
		return $this->fetch('', [
		    'datas' => $datas,
			'meishicats' => $meishicats,
			'mainads' => $mainads,
			'rightads' => $rightads,
		
		]);
    }









}
?>